package com.liuhuanss.voiceprint.dto;

import jakarta.validation.constraints.NotBlank;

/**
 * 登录请求DTO
 * 
 * @author liuhuanss
 * @version 1.0
 */
public class LoginRequest {

    @NotBlank(message = "用户名不能为空")
    private String username;

    private String password;

    private String audioBase64;

    private String loginType; // "password" 或 "voiceprint"

    // 默认构造函数
    public LoginRequest() {}

    // 构造函数
    public LoginRequest(String username, String password, String audioBase64, String loginType) {
        this.username = username;
        this.password = password;
        this.audioBase64 = audioBase64;
        this.loginType = loginType;
    }

    // Getters and Setters
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getAudioBase64() {
        return audioBase64;
    }

    public void setAudioBase64(String audioBase64) {
        this.audioBase64 = audioBase64;
    }

    public String getLoginType() {
        return loginType;
    }

    public void setLoginType(String loginType) {
        this.loginType = loginType;
    }

    @Override
    public String toString() {
        return "LoginRequest{" +
                "username='" + username + '\'' +
                ", loginType='" + loginType + '\'' +
                ", hasAudio=" + (audioBase64 != null && !audioBase64.isEmpty()) +
                '}';
    }
}